php forum
php mysql forum
php mysql smarty
 
Page 1 of 3 1 2 3 >
Topic Options
#219761 - 06/25/02 12:03 AM [6.1.x] Last Post By
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
I think this is ready for prime time. Allen has put this through the hoops here at threadsdev and after some heavy stomping I think we got the bugs out. <img src="/threads/php/images/icons/wink.gif" alt="" /><br /><br />This modification will display who made the last post in a thread that links to the related last post (simular to a .classic modification). This information will be displayed in the "last post" column of the postlist.php script. Also note that this was made to work with MySQL database only.<br /><br /><br />The following files will need to be modified:<br />__ postlist.php __________ (threads directory)<br />__ postlist.tmpl _________ (threads directory)<br />__ addpost.php ___________ (threads directory)<br />__ doapproveposts.php ____ (admin directory)<br />__ viewunapproved.php ____ (admin directory)<br />__ deletepost.php ________ (threads directory)<br /><br />This modification will require 3 additional fields to be added to your w3t_Posts table in your database. An "alter table" script is included to make these additions for you.<br /><br />The file is attached. Enjoy! <img src="/threads/php/images/icons/smile.gif" alt="" />


Attachments
51077-lastpostby.6.1.zip (61 downloads)

_________________________
~Dave
ChattersOnline.com

Top
#219762 - 06/25/02 01:14 AM Re: Last Post By 6.1 [Re: sjsaunders]
Lisa_P Offline
Enthusiast

Registered: 03/09/02
Posts: 329
Loc: Michigan, USA
Thanks Dave! <img src="/forum/images/icons/smile.gif" alt="" /><br /><br />In step 2 you say to find this:<br /><pre><font class="small">code:</font><hr> if (!$ThreadRating) { $ThreadRating = "&nbsp;"; }<br /><br /> // Setup the postrow array</pre><hr><br /><br />and your hack to show the word "sticky" on sticky notes begins below that first line. Should the sticky code remain below the first line, and before the rest of this hack, or go elsewhere?
_________________________
[:"red"]Lisa[/]

Top
#219763 - 06/25/02 01:23 AM Re: Last Post By 6.1 [Re: JacquiL]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
Hi Lisa <img src="/forum/images/icons/smile.gif" alt="" /><br /><br />You can leave the "sticky post" code where it is and add this new code right below it and everything should work.<br /><br />Let me know if it doesn't so I can loose some sleep over it... lol <img src="/forum/images/icons/wink.gif" alt="" />
_________________________
~Dave
ChattersOnline.com

Top
#219764 - 08/29/02 09:58 PM Re: Last Post By 6.1 [Re: sjsaunders]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
There are some cases where the "last post by" information isn't being updated when a reply is deleted. Below is what I believe is the fix. Let me know otherwise.. <img src="/forum/images/icons/wink.gif" alt="" /><br /><br />In the instructions change this:<br /><br /><pre><font class="small">code:</font><hr><br />Step 7.<br /> In your deletepost.php script find this:<br /><br /> <br /> // ------------------------------------------------------------<br /> // We also need to decrease the number of replies in this topic<br /> $query = " <br /> UPDATE w3t_Posts<br /> SET B_Replies = B_Replies -1<br /> WHERE B_Number = '$Main'<br /> ";<br /> $dbh -> do_query($query);<br /><br /> <br /> and change it to this:<br /><br /> <br /> $query = "<br /> SELECT B_Number,B_Username,B_Approved<br /> FROM w3t_Posts<br /> WHERE B_Board = '$Board_q'<br /> AND B_Approved = 'yes'<br /> AND B_Main = '$Main'<br /> AND B_Main <> B_Number<br /> ORDER BY B_Number DESC<br /> LIMIT 1<br /> ";<br /> $lastPost = $dbh -> do_query($query); <br /> list($lastNumber,$lastName,$lastApproved) = $dbh -> fetch_array($lastPost);<br /> $lastName = addslashes($lastName);<br /><br /> // ------------------------------------------------------------<br /> // We also need to decrease the number of replies in this topic<br /> $query = " <br /> UPDATE w3t_Posts<br /> SET B_Replies = B_Replies -1,<br /> B_Last_Number = '$lastNumber',<br /> B_Last_Name = '$lastName',<br /> B_Last_Approved = '$lastApproved' <br /> WHERE B_Number = '$Main'<br /> ";<br /> $dbh -> do_query($query); <br /><br /></pre><hr><br /><br />to this:<br /><br /><pre><font class="small">code:</font><hr><br />Step 7.<br /> In your deletepost.php script find this:<br /><br /> <br /> // ------------------------------------------------------------<br /> // We also need to decrease the number of replies in this topic<br /> $query = " <br /> UPDATE w3t_Posts<br /> SET B_Replies = B_Replies -1<br /> WHERE B_Number = '$Main'<br /> ";<br /> $dbh -> do_query($query);<br /><br /> <br /> and change it to this:<br /><br /> <br /> $query = "<br /> SELECT B_Main,B_Number,B_Username,B_Approved<br /> FROM w3t_Posts<br /> WHERE B_Board = '$Board_q'<br /> AND B_Approved = 'yes'<br /> AND B_Main = '$Main'<br /> ORDER BY B_Number DESC<br /> LIMIT 1<br /> ";<br /> $lastPost = $dbh -> do_query($query); <br /> list($lastMain,$lastNumber,$lastName,$lastApproved) = $dbh -> fetch_array($lastPost);<br /> $lastName = addslashes($lastName);<br /> if ($lastMain == $lastNumber) {<br /> // It's the main post therefore no replies left, right?<br /> $lastNumber = "";<br /> $lastName = "";<br /> $lastApproved = "";<br /> }<br /><br /> // ------------------------------------------------------------<br /> // We also need to decrease the number of replies in this topic<br /> $query = " <br /> UPDATE w3t_Posts<br /> SET B_Replies = B_Replies -1,<br /> B_Last_Number = '$lastNumber',<br /> B_Last_Name = '$lastName',<br /> B_Last_Approved = '$lastApproved' <br /> WHERE B_Number = '$Main'<br /> ";<br /> $dbh -> do_query($query); <br /><br /></pre><hr><br /><br />This may or may not be the cure but it is fixing a flaw in the code none the less. <img src="/forum/images/icons/smile.gif" alt="" />
_________________________
~Dave
ChattersOnline.com

Top
#219765 - 09/11/02 12:06 AM Re: Last Post By 6.1 [Re: sjsaunders]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Is it me?<br /><br />Or is there no change in step 6?<br /><br /><pre><font class="small">code:</font><hr><br />Step 6.<br /> In your viewunapproved.php script find this:<br /><br /><br /> // ----------------------------------------<br /> // Grab the unapproved posts for this board <br /> $Keyword_q = addslashes($Keyword);<br /> $query = "<br /> SELECT B_Number,B_Subject,B_Username,B_Posted <br /> FROM {$config['tbprefix']}Posts <br /> WHERE B_Approved = 'no'<br /> AND B_Board = '$Keyword_q'<br /> ORDER BY B_Posted DESC<br /> ";<br /><br /> <br /> and change it to this:<br /><br /> <br /> // ----------------------------------------<br /> // Grab the unapproved posts for this board <br /> $Keyword_q = addslashes($Keyword);<br /> $query = "<br /> SELECT B_Number,B_Subject,B_Username,B_Posted <br /> FROM {$config['tbprefix']}Posts <br /> WHERE B_Approved = 'no'<br /> AND B_Board = '$Keyword_q'<br /> ORDER BY B_Number DESC<br /> "; <br /></pre><hr>
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#219766 - 09/11/02 06:03 AM Re: Last Post By 6.1 [Re: Daine]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1966
Loc: Sweden, Stockholm
It seems that the ORDER BY is changed from B_Posted to B_Number.
_________________________
/Gardener | Complete list of my mods

Top
#219767 - 09/11/02 09:54 AM Re: Last Post By 6.1 [Re: c0bra]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
<img src="/forum/images/icons/tongue.gif" alt="" /><br /><br />I need some sleep. <br /><br /><br />Thx.
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#219768 - 09/12/02 01:20 AM Re: Last Post By 6.1 [Re: sjsaunders]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Hmmmm....<br /><br />I may need more sleep.<br /><br />I've been setting this up on a test board, on 6.1<br /><br />I don't know if I missed a step, but sometimes the last post link is wrong.<br /><br />If this is the link:<br /><br />/showflat.php?Cat=&Board=test&Number=56454&page=0&view=collapsed&sb=5&o=&fpart=1#Post56454<br /><br />Sometimes it's like this:<br /><br />/showflat.php?Cat=&Board=test&Number=56454&page=0&view=collapsed&sb=5&o=&fpart=2#Post56454<br /><br />Note the part=2 instead of 1... if I change the link it works fine.<br /><br />I thought it might be my quick reply mod... but no, I can't seem to find any consistency... <br /><br />I've updated for 6.1 with 'theprefix' variables... but something isn't quite right.<br /><br /><br />Dave, <br />Any idea if this bit of code needs to be tweaked for 6.1???<br /><br />Thx.
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#219769 - 09/12/02 06:30 AM Re: Last Post By 6.1 [Re: Daine]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
I'll have a look before lunch. <img src="/forum/images/icons/smile.gif" alt="" />
_________________________
~Dave
ChattersOnline.com

Top
#219770 - 09/12/02 10:39 AM Re: Last Post By 6.1 [Re: Daine]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
I'll have to set this up somewhere so I can test it. I can't seem to see what may be going wrong. It's been working fine on 6.0.x hasnt it?
_________________________
~Dave
ChattersOnline.com

Top
#219771 - 09/12/02 11:18 AM Re: Last Post By 6.1 [Re: sjsaunders]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
I had never used it.<br /><br />But I've also got the quick reply mod. But quick reply still uses addpost.php so that shouldn't have any effect.<br />Did some testing here last night and all seemed fine with it.<br /><br />It was pretty simple to install.. and the problem would be with postlist if anything... based on what's happening.<br /><br />Of course I've got a few other mods. Maybe I need to set this up on a clean 6.1 and see if I have the same trouble.
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#219772 - 09/12/02 01:45 PM Re: Last Post By 6.1 [Re: Daine]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Hey Dave, <br />Before you go to any trouble... let me ask you this:<br /><br />Is the part= calculated in postlist.php? It's not pulled from the database is it? I don't really understand what this is or means.<br /><br />In other words... if it's calculated in postlist.php, then my other scripts should be fine... and I should start with a Clean postlist.php and add things back in to see if it behaves. <img src="/forum/images/icons/tongue.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#219773 - 09/12/02 02:22 PM Re: Last Post By 6.1 [Re: Daine]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
fpart is calculated and not pulled from any database. <img src="/forum/images/icons/smile.gif" alt="" /><br /><br />It is the page the post is on. If you look at a post link with more than one page of replies you can mouse over the number links and see that fpart changes according to the page. 6.1's postlist may be calculating this at some other point but I can't say for sure.
_________________________
~Dave
ChattersOnline.com

Top
#219774 - 09/12/02 02:57 PM Re: Last Post By 6.1 [Re: sjsaunders]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Thanks.<br /><br />I just figured this out.<br /><br />The link wasn't working for the First Post (with a last post link) at the top of postlist because I had a sticky post with no "last post" info above it. once I either unstuck it... or did a reply to the sticky, then all seemed to work.<br />I guess it didn't like having a post in front of it without the last post data. <br /><br />Either way... this hiccup would work itself out as the data is populated when people make replies. <br /><br />Thanks for your help. <br />I will post tweaked instructions for use with .threads 6.1 shortly.
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#219775 - 09/12/02 04:08 PM Re: Last Post By 6.1 [Re: Daine]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
Ok sounds good. <img src="/forum/images/icons/smile.gif" alt="" /><br /><br />Yeah there will be no "last post by" information till someone actually makes a reply to the main post.
_________________________
~Dave
ChattersOnline.com

Top
#219776 - 09/12/02 04:52 PM Re: Last Post By 6.1 [Re: sjsaunders]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Right... and it doesn't like one without the info begin above one with the info. Just went live with it and it all seems to work. I replied to all my sticky posts to avoid the issue.<br /><br />Thanks!
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#219777 - 09/12/02 04:54 PM Re: Last Post By 6.1 [Re: sjsaunders]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Attached to this post is a version and instructions to use this hack with .threads 6.1.<br /><br />There were a few minor changes. The Database 'theprefix' variable...and postlist called a few more things to use the disk icon etc...<br />So I've adjusted the instructions and added the prefix to the altertable file and all seems to be working well on my 6.1 br1 site. <br /><br />


Attachments
56505-lastpostbyfor6.1 folder.zip (39 downloads)

_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#219778 - 09/12/02 04:57 PM Re: Last Post By 6.1 [Re: Daine]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
Thanks Josh <img src="/forum/images/icons/smile.gif" alt="" />
_________________________
~Dave
ChattersOnline.com

Top
#219779 - 09/12/02 05:01 PM Re: Last Post By 6.1 [Re: sjsaunders]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
I should have reiterated Loudly...<br />That I take no credit for such a creation other than a few very simple tweaks for ver 6.1.<br /><br />It's All JustDave's wonderful work. <img src="/forum/images/icons/smile.gif" alt="" /><br /><br />I shall do the menial tweaking while you create more cool stuff like IIP. <img src="/forum/images/icons/wink.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#219780 - 09/14/02 02:49 AM Re: Last Post By 6.1 [Re: Daine]
Aglavalin Offline
Enthusiast

Registered: 06/18/02
Posts: 394
Loc: Southern California
Which hack is it that inserts the last post by info on the ubbthreads.php page? The Forum Index, like this site has.

Top
Page 1 of 3 1 2 3 >



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks